package com.achilles.widget;

import android.content.Context;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;

import com.achilles.bean.DataBean;

/**
 * Created by AchillesL on 2016-9-21.
 */
public abstract class DialogView {
    protected final View mContentView;

    public DialogView(Context context) {
        mContentView = LayoutInflater.from(context).inflate(getViewLayout(),null);
        initView(mContentView);
    }

    protected abstract int getViewLayout();
    protected abstract void initView(View contentView);
    public abstract void editData(DataBean dataBean);
    public abstract DataBean getData();
    public abstract boolean isParamValid();
    public abstract void reset();
    public abstract boolean onKeyDown(int keyCode, KeyEvent event);

    public View getView() {
        return mContentView;
    }
}
